{% extends 'studentes/base.html' %}
{% block students_index %}
    <div class="container">

            {% csrf_token %}
            <div class="col-8 offset-2" style="border: 1px solid #4f4848;border-radius: 15px;
        background-color: rgba(169,162,162,0.05);margin-top: 30px;margin-bottom: 40px;">
                <div style="margin: 30px 30px 30px 30px ">
                    <div class="text-center">
                        <h4 style="">{{ exercise.exercises }}</h4>
                        <h3 style="color:#de2323;font-family: '华文行楷'" class="text-end">
                            成绩：{{ exercise.exercises2_set.get }} %</h3>
                        <p>时间：{{ exercise.exercises2_set.get.myTime }}</p>
                    </div>
                    {#        for 语句#}

                    {% for i in answer %}
                        <h6 class="form-label"><span class="badge rounded-pill bg-success">{{ forloop.counter }}</span>&emsp;{{ i.title }}
                            <div class="text-end">
                                {% if i.correctAnswer == i.answer2_set.get.stuAnswer %}
                                    <span class="badge bg-success">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                         class="bi bi-check-lg" viewBox="0 0 16 16">
  <path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"/>
</svg>
                                </span>
                                {% else %}
                                    <span class="badge bg-danger">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16"
                                         height="16" fill="currentColor" class="bi bi-x-lg"
                                         viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M13.854 2.146a.5.5 0 0 1 0 .708l-11 11a.5.5 0 0 1-.708-.708l11-11a.5.5 0 0 1 .708 0Z"/>
  <path fill-rule="evenodd" d="M2.146 2.146a.5.5 0 0 0 0 .708l11 11a.5.5 0 0 0 .708-.708l-11-11a.5.5 0 0 0-.708 0Z"/>
</svg>
                                    </span>
                                {% endif %}


                            </div>
                        </h6>

                        <div style="margin-left: 30px;font-size: small">
                            <div class="form-check">
                                <input required="required" disabled class="form-check-input" type="radio"
                                       name="{{ i.id }}"
                                       id="flexRadioDefault-a-{{ i.id }}" value="1">
                                <label class="form-check-label w-100" for="flexRadioDefault-a-{{ i.id }}">
                                    A.{{ i.answerA }}
                                </label>
                            </div>
                            <div class="form-check">
                                <input required="required" disabled class="form-check-input" type="radio"
                                       name="{{ i.id }}"
                                       id="flexRadioDefault-b-{{ i.id }}" value="2">
                                <label class="form-check-label w-100" for="flexRadioDefault-b-{{ i.id }}">
                                    B.{{ i.answerB }}
                                </label>
                            </div>
                            <div class="form-check">
                                <input required="required" disabled class="form-check-input" type="radio"
                                       name="{{ i.id }}"
                                       id="flexRadioDefault-c-{{ i.id }}" value="3">
                                <label class="form-check-label w-100" for="flexRadioDefault-c-{{ i.id }}">
                                    C.{{ i.answerC }}
                                </label>
                            </div>
                            <div class="form-check">
                                <input required="required" disabled class="form-check-input" type="radio"
                                       name="{{ i.id }}"
                                       id="flexRadioDefault-d-{{ i.id }}" value="4">
                                <label class="form-check-label w-100" for="flexRadioDefault-d-{{ i.id }}">
                                    D.{{ i.answerD }}
                                </label>
                            </div>
                            <br>
                            <div class="mb-3">
                                <h6 style="color: #af4b4b">你的答案：

                                    {% if i.answer2_set.get.stuAnswer == 1 %}
                                        A
                                    {% elif i.answer2_set.get.stuAnswer == 2 %}
                                        B
                                    {% elif i.answer2_set.get.stuAnswer == 3 %}
                                        C
                                    {% elif i.answer2_set.get.stuAnswer == 4 %}
                                        D
                                    {% endif %}
                                </h6>
                                <h6 style="color: #af4b4b">正确答案：
                                    {% if i.correctAnswer == 1 %}
                                        A
                                    {% elif i.correctAnswer == 2 %}
                                        B
                                    {% elif i.correctAnswer == 3 %}
                                        C
                                    {% elif i.correctAnswer == 4 %}
                                        D
                                    {% endif %}
                                </h6>

                            </div>

                            <br>

                        </div>

                    {% endfor %}

                </div>
            </div>

    </div>


{% endblock %}